﻿using Ninject;
using RRKAutohaus.Core;
using RRKAutohaus.Core.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;

namespace RRKAutohaus.Web.App_Start
{
    public class IocConfig
    {
        public static void RegisterIoc(HttpConfiguration conf)
        {
            var kernel = new StandardKernel();

            kernel.Bind<IUnitOfWork>().To<UnitOfWork>();
            kernel.Bind<RepositoryFactories>().To<RepositoryFactories>()
                .InSingletonScope();
            kernel.Bind<IRepositoryProvider>().To<RepositoryProvider>();

            conf.DependencyResolver = new NinjectDependencyResolver(kernel);
        }
    }
}